package com.csot.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebContextConfigurer implements WebMvcConfigurer {

	@Bean
	public IpInjectInterceptor getIpInjectInterceptor() {
		return new IpInjectInterceptor();
	}

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// TODO Auto-generated method stub
		WebMvcConfigurer.super.addInterceptors(registry);
		registry.addWebRequestInterceptor(getIpInjectInterceptor()).addPathPatterns("/*ipmanagement/**");

	}

}
